﻿@{
    ViewBag.Title = Local("EditProfile");
}

@model User
           
@using (Html.BeginForm())
{ 
<div class="box">
    <label>@Local("User.NickName")</label>
    <div class="right">
        @Html.TextBoxFor(model=>model.NickName)
    </div>
</div>
    
<div class="box">
    <label>@Local("User.Gender")</label>
    <div class="right">
        @Html.DropdownListForEnum(model => model.Gender, null, null, AreaName)
    </div>
</div>
    
<div class="box">
    <label>@Local("User.BirthDate")</label>
    <div class="right">
        @Html.DropdownListNumberRangeFor(model => model.BirthYear, DateTime.Now.Year, DateTime.Now.Year - 100) @Local("User.BirthYear") 
        @Html.DropdownListNumberRangeFor(model => model.BirthMonth, 1, 12) @Local("User.BirthMonth") 
        @Html.DropdownListNumberRangeFor(model => model.BirthDay, 1, 31) @Local("User.BirthDay") 
    </div>
</div>
    
<div class="box">
    <label>@Local("User.TimeZone")</label>
    <div class="right">
        @Html.DropdownListForTimeZone(model => model.TimeZone)
    </div>
</div>
    
<div class="box">
    <label>@Local("User.Avatar")</label>
    <div class="right">
        <input type="hidden" id="avatar" name="Avatar" value="@Model.Avatar" />
        <img src="@Model.Avatar" alt="@Local("User.Avatar.Set")" title="@Local("User.Avatar.Set")" id="avatar-image" onclick="return openModal('@UCenterUrls.DialogDiskView?type=@FileType.Image', 500);" style="width:@(AppConfig.AvatarWidth)px; height:@(AppConfig.AvatarHeight)px;" />
    </div>
</div>
<script type="text/javascript">
    function callback(id) {
        var url = '@GetFileBrowserUrl()' + id;
        $('#avatar-image').attr('src', url);
        $('#avatar').val(url);
    }
</script>
    
<div class="box">
    <button class="submit">@Local("User.Save")</button>
</div>   
}
